
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>导航布局 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="MODEL.html" />
    
    
    <link rel="prev" href="STYLE.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="START.html">
            
                <a href="START.html">
            
                    
                    快速开始
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="MENU.html">
            
                <a href="MENU.html">
            
                    
                    菜单配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="PAGE.html">
            
                <a href="PAGE.html">
            
                    
                    页面开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="ROUTE.html">
            
                <a href="ROUTE.html">
            
                    
                    系统路由
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="AJAX.html">
            
                <a href="AJAX.html">
            
                    
                    Ajax请求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="MOCK.html">
            
                <a href="MOCK.html">
            
                    
                    Mock模拟数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="STYLE.html">
            
                <a href="STYLE.html">
            
                    
                    样式&主题
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.9" data-path="LAYOUT.html">
            
                <a href="LAYOUT.html">
            
                    
                    导航布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="MODEL.html">
            
                <a href="MODEL.html">
            
                    
                    Model(Redux)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="I18N.html">
            
                <a href="I18N.html">
            
                    
                    国际化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="PERMISSION.html">
            
                <a href="PERMISSION.html">
            
                    
                    权限控制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="NGINX.html">
            
                <a href="NGINX.html">
            
                    
                    Nginx配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="PROXY.html">
            
                <a href="PROXY.html">
            
                    
                    开发代理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="OTHER.html">
            
                <a href="OTHER.html">
            
                    
                    其他
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >导航布局</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x5BFC;&#x822A;&#x5E03;&#x5C40;">&#x5BFC;&#x822A;&#x5E03;&#x5C40;</h1>
<p>&#x4E3A;&#x4E86;&#x6EE1;&#x8DB3;&#x4E0D;&#x540C;&#x7CFB;&#x7EDF;&#x7684;&#x9700;&#x6C42;&#xFF0C;&#x63D0;&#x4F9B;&#x4E86;&#x56DB;&#x79CD;&#x5BFC;&#x822A;&#x5E03;&#x5C40;&#xFF1A;</p>
<ul>
<li>&#x5934;&#x90E8;&#x83DC;&#x5355;</li>
<li>&#x5DE6;&#x4FA7;&#x83DC;&#x5355;</li>
<li>&#x5934;&#x90E8;+&#x5DE6;&#x4FA7;&#x83DC;&#x5355;</li>
<li>tab&#x9875;&#x65B9;&#x5F0F;</li>
</ul>
<h2 id="&#x66F4;&#x6539;&#x65B9;&#x5F0F;">&#x66F4;&#x6539;&#x65B9;&#x5F0F;</h2>
<ul>
<li>&#x7528;&#x6237;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; &#x9875;&#x9762;&#x6709;&#x4E0A;&#x89D2;&#x7528;&#x6237;&#x5934;&#x50CF; -&gt; &#x8BBE;&#x7F6E; &#x9875;&#x9762;&#x8FDB;&#x884C;&#x9009;&#x62E9;&#xFF08;&#x5982;&#x679C;&#x60A8;&#x4E3A;&#x7528;&#x6237;&#x63D0;&#x4F9B;&#x4E86;&#x6B64;&#x9875;&#x9762;&#xFF09;&#xFF1B;</li>
<li>&#x5F00;&#x53D1;&#x4EBA;&#x5458;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4FEE;&#x6539;<code>src/models/settings.js</code>&#x6307;&#x5B9A;&#x5E03;&#x5C40;&#x65B9;&#x5F0F;&#xFF1B;</li>
</ul>
<h2 id="&#x4E0D;&#x9700;&#x8981;&#x5BFC;&#x822A;">&#x4E0D;&#x9700;&#x8981;&#x5BFC;&#x822A;</h2>
<p>&#x6709;&#x4E9B;&#x9875;&#x9762;&#x53EF;&#x80FD;&#x4E0D;&#x9700;&#x8981;&#x663E;&#x793A;&#x5BFC;&#x822A;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x5982;&#x4E0B;&#x4EFB;&#x610F;&#x4E00;&#x79CD;&#x65B9;&#x5F0F;&#x8FDB;&#x884C;&#x8BBE;&#x7F6E;&#xFF1A;</p>
<ul>
<li>&#x9875;&#x9762;&#x914D;&#x7F6E;&#x9AD8;&#x7EA7;&#x7EC4;&#x4EF6;<pre><code class="lang-js">  @config({
      noFrame: <span class="hljs-literal">true</span>,
  })
</code></pre>
</li>
<li>&#x6D4F;&#x89C8;&#x5668;url&#x4E2D;noFrame=true&#x53C2;&#x6570; <pre><code>  /path/to?noFrame=true
</code></pre></li>
</ul>
<h2 id="tab&#x6807;&#x7B7E;&#x9875;">Tab&#x6807;&#x7B7E;&#x9875;</h2>
<p>&#x9875;&#x9762;&#x5934;&#x90E8;&#x6807;&#x7B7E;&#xFF0C;&#x6709;&#x5982;&#x4E0B;&#x7279;&#x6027;&#xFF1A;</p>
<ol>
<li>&#x5728;&#x5F53;&#x524D;tab&#x6807;&#x7B7E;&#x4E4B;&#x540E;&#x6253;&#x5F00;&#x65B0;&#x7684;tab&#x6807;&#x7B7E;&#xFF1B;</li>
<li>&#x8BB0;&#x5F55;&#x5E76;&#x6062;&#x590D;&#x6EDA;&#x52A8;&#x6761;&#x4F4D;&#x7F6E;&#xFF1B;</li>
<li>&#x4FDD;&#x6301;&#x9875;&#x9762;&#x72B6;&#x6001;&#xFF08;&#x9700;&#x8981;&#x5F00;&#x542F;<code>Keep Page Alive</code>&#xFF09;&#xFF1B;</li>
<li>tab&#x6807;&#x7B7E;&#x53F3;&#x952E;&#x64CD;&#x4F5C;&#xFF1B;</li>
<li>tab&#x9875;&#x64CD;&#x4F5C;API&#xFF1B;</li>
<li>tab&#x6807;&#x7B7E;&#x62D6;&#x62FD;&#x6392;&#x5E8F;&#xFF1B;</li>
<li>&#x5173;&#x95ED;&#x4E00;&#x4E2A;&#x4E8C;&#x7EA7;&#x9875;&#x9762;tab&#xFF0C;&#x5C1D;&#x8BD5;&#x6253;&#x5F00;&#x5B83;&#x7684;&#x7236;&#x7EA7;&#xFF1B;</li>
</ol>
<h3 id="tab&#x64CD;&#x4F5C;api">Tab&#x64CD;&#x4F5C;API</h3>
<p>system model&#xFF08;redux&#xFF09;&#x4E2D;&#x63D0;&#x4F9B;&#x4E86;&#x5982;&#x4E0B;&#x64CD;&#x4F5C;tab&#x9875;&#x7684;&#x65B9;&#x6CD5;&#xFF1A;</p>
<table>
<thead>
<tr>
<th>API</th>
<th>&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>setCurrentTabTitle(title)</td>
<td>&#x8BBE;&#x7F6E;&#x5F53;&#x524D;&#x6FC0;&#x6D3B;&#x7684; tab &#x6807;&#x9898; title: stirng &#x6216; {local, text, icon} local&#x5BF9;&#x5E94; i18n.menu&#x4E2D;&#x5B57;&#x6BB5;</td>
</tr>
<tr>
<td>refreshTab(targetPath)</td>
<td>&#x5237;&#x65B0;targetPath&#x6307;&#x5B9A;&#x7684;tab&#x9875;&#x5185;&#x5BB9;&#xFF08;&#x91CD;&#x65B0;&#x6E32;&#x67D3;&#xFF09;</td>
</tr>
<tr>
<td>refreshAllTab()</td>
<td>&#x5237;&#x65B0;&#x6240;&#x6709;tab&#x9875;&#x5185;&#x5BB9;&#xFF08;&#x91CD;&#x65B0;&#x6E32;&#x67D3;&#xFF09;</td>
</tr>
<tr>
<td>closeCurrentTab()</td>
<td>&#x5173;&#x95ED;&#x5F53;&#x524D;tab&#x9875;</td>
</tr>
<tr>
<td>closeTab(targetPath)</td>
<td>&#x5173;&#x95ED;targetPath&#x5BF9;&#x5E94;&#x7684;tab&#x9875;</td>
</tr>
<tr>
<td>closeOtherTabs(targetPath)</td>
<td>&#x5173;&#x95ED;&#x9664;&#x4E86;targetPath&#x5BF9;&#x5E94;&#x7684;tab&#x9875;&#x4E4B;&#x5916;&#x7684;&#x6240;&#x6709;tab&#x9875;</td>
</tr>
<tr>
<td>closeAllTabs()</td>
<td>&#x5173;&#x95ED;&#x6240;&#x6709;tab&#x9875;&#xFF0C;&#x7CFB;&#x7EDF;&#x5C06;&#x8DF3;&#x8F6C;&#x9996;&#x9875;</td>
</tr>
<tr>
<td>closeLeftTabs(targetPath)</td>
<td>&#x5173;&#x95ED;targetPath&#x5BF9;&#x5E94;&#x7684;tab&#x9875;&#x5DE6;&#x4FA7;&#x6240;&#x6709;tab&#x9875;</td>
</tr>
<tr>
<td>closeRightTabs(targetPath)</td>
<td>&#x5173;&#x95ED;targetPath&#x5BF9;&#x5E94;&#x7684;tab&#x9875;&#x53F3;&#x4FA7;&#x6240;&#x6709;&#x7684;tab&#x9875;</td>
</tr>
</tbody>
</table>
<p>&#x4F7F;&#x7528;&#x65B9;&#x5F0F;&#xFF1A;</p>
<pre><code class="lang-jsx"><span class="hljs-keyword">import</span> config <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;@/commons/config-hoc&apos;</span>;

@config({
    connect: <span class="hljs-literal">true</span>,
})
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SomeComponent</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">React</span>.<span class="hljs-title">Component</span> </span>{
    componentDidMount() {
        <span class="hljs-keyword">this</span>.props.action.system.closeTab(<span class="hljs-string">&apos;/some/path&apos;</span>);
    }
    ...
}
</code></pre>
<p>&#x6CE8;&#xFF1A;</p>
<ol>
<li>tab&#x57FA;&#x4E8E;&#x9875;&#x9762;&#x5730;&#x5740;&#xFF0C;&#x6BCF;&#x5F53;&#x4F7F;&#x7528;<code>this.props.history.push(&apos;/some/path&apos;)</code>&#xFF0C;&#x5C31;&#x4F1A;&#x9009;&#x4E2D;&#x6216;&#x8005;&#x65B0;&#x6253;&#x5F00;&#x4E00;&#x4E2A;tab&#x9875;&#xFF08;<code>/path</code> &#x4E0E; <code>/path?name=Tom</code>&#x5C5E;&#x4E8E;&#x4E0D;&#x540C;url&#x5730;&#x5740;&#xFF0C;&#x4F1A;&#x5BF9;&#x5E94;&#x4E24;&#x4E2A;tab&#x9875;&#xFF09;&#xFF1B;</li>
<li>&#x6CA1;&#x6709;&#x83DC;&#x5355;&#x5BF9;&#x5E94;&#x7684;&#x9875;&#x9762;&#xFF0C;&#x9700;&#x8981;&#x5355;&#x72EC;&#x8BBE;&#x7F6E;title&#xFF0C;&#x5426;&#x5219;tab&#x6807;&#x7B7E;&#x5C06;&#x6CA1;&#x6709;title;</li>
</ol>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="STYLE.html" class="navigation navigation-prev " aria-label="Previous page: 样式&主题">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="MODEL.html" class="navigation navigation-next " aria-label="Next page: Model(Redux)">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"导航布局","level":"1.9","depth":1,"next":{"title":"Model(Redux)","level":"1.10","depth":1,"path":"MODEL.md","ref":"MODEL.md","articles":[]},"previous":{"title":"样式&主题","level":"1.8","depth":1,"path":"STYLE.md","ref":"STYLE.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"LAYOUT.md","mtime":"2019-02-16T09:08:05.321Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-02-17T03:27:10.809Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

